UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YF/5e5gNxZv5J13VOVEm24A7HTwCXDNtknAIGf+zVrs=' 
WHERE 
  key_id = '244c34c6bd5f89eaf75327a137ea35a9a3cf341b24a3dc5b35bd64ef98ec5c09' 
  AND (
    token = 'YF/5e5gNxZv5J13VOVEm24A7HTwCXDNtknAIGf+zVrs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025