UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VkMxnwn7MyIIMUhY0yWuAER3cWTJvT+S6bNYuw/exg4=' 
WHERE 
  key_id = 'fbf3e6091a4da820b99f5fffa1fd92be8d487bbf3ec862c25de897041bceff4e' 
  AND (
    token = 'VkMxnwn7MyIIMUhY0yWuAER3cWTJvT+S6bNYuw/exg4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016