UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PgLKepEOVrNQEbHVJZ/oNVGJf6gOO37dNpvqK2lo3tQ=' 
WHERE 
  key_id = '3dbdce3d7c66d885375feafe1346c2899517d77ce1c81c2dd4def551ef53aacf' 
  AND (
    token = 'PgLKepEOVrNQEbHVJZ/oNVGJf6gOO37dNpvqK2lo3tQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030