UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Bo6yxEbKeSafx1tWP1GbQ2r1WXl7xZUIHFMAOztj2Qw=' 
WHERE 
  key_id = '9293a0cf29d2aba1cafe40d657327f95aa5769bfc4b4c74bfcebe18c66bc009d' 
  AND (
    token = 'Bo6yxEbKeSafx1tWP1GbQ2r1WXl7xZUIHFMAOztj2Qw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063