UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RarKLRK3kylEQ5whoimbRfZf4J6aP5dsFlv7hTbWMwY=' 
WHERE 
  key_id = 'a0e411ca37786e8e09f46f0e2b95a529f88acb49d46ef3438555a4e45635aa4d' 
  AND (
    token = 'RarKLRK3kylEQ5whoimbRfZf4J6aP5dsFlv7hTbWMwY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023