UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u/w8fDCl8lSkCMrVKlFmic7sV3NpOsS1C5zkVdg5DP0=' 
WHERE 
  key_id = '79f4a78e429e1425803fb61e1b4ac33cb50c401603c8c586c59e20c007997f68' 
  AND (
    token = 'u/w8fDCl8lSkCMrVKlFmic7sV3NpOsS1C5zkVdg5DP0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024