UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sSrXT3tBX2jfrCbFum1A9euELl2kBGUhO7x7jCmOvaQ=' 
WHERE 
  key_id = '15ac8f6196e6e9523e81c982d3d7293954f53c0831d290b69f8c20fd3aeb3e3b' 
  AND (
    token = 'sSrXT3tBX2jfrCbFum1A9euELl2kBGUhO7x7jCmOvaQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034