UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jSXWCf9dXdc98saojE1dP2UW4Y4yltO0HoasF2+BqSI=' 
WHERE 
  key_id = 'f203893c9212cc407b498a14a1fef2403806a97c01e1ef294a9804e69ce5bc55' 
  AND (
    token = 'jSXWCf9dXdc98saojE1dP2UW4Y4yltO0HoasF2+BqSI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039