UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UyPnqItTUZWCW+3lkWpK3ib4uoSwmtFN7YR/VquqHG0=' 
WHERE 
  key_id = 'c5e60ea19ef8c886c23a427d454d58add0388ccc4c6710a62f95cf3affa0d0ca' 
  AND (
    token = 'UyPnqItTUZWCW+3lkWpK3ib4uoSwmtFN7YR/VquqHG0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039