UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SYluzTG5Ew9qVkyniLlwqy8/z/r40JFneEzVbudJ7YE=' 
WHERE 
  key_id = 'ac36128702d8dfb65ca2d5e6eaf5c7309d292223cf12de6a2a8bff0bcf6a6656' 
  AND (
    token = 'SYluzTG5Ew9qVkyniLlwqy8/z/r40JFneEzVbudJ7YE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039