UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oTRr6vlVOB3SYoM/UeG9Jg2cao+dqc55Jze63tXVikU=' 
WHERE 
  key_id = 'ce4be25aebb776e65ca3ec67759274b0c6a6ad428c9de6149d1f891344beac2e' 
  AND (
    token = 'oTRr6vlVOB3SYoM/UeG9Jg2cao+dqc55Jze63tXVikU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024