UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZoD7R81RwtRWLPH1Pri0yiwQrwIanCBB5UpfoEF+kNg=' 
WHERE 
  key_id = 'e403844864b455347fd27d4e859108e86a68c4b652cff811290a807284255632' 
  AND (
    token = 'ZoD7R81RwtRWLPH1Pri0yiwQrwIanCBB5UpfoEF+kNg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029