UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3C1eM4s/t8by7XfmLcfbHinypxUbGBcJ2xn9yCFMrRc=' 
WHERE 
  key_id = '325fbe6e30dc614916b11d88f9e9a50ebfdb037a4cc8bcc60cc59f722262e329' 
  AND (
    token = '3C1eM4s/t8by7XfmLcfbHinypxUbGBcJ2xn9yCFMrRc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036