UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ph3KCtJDeZtiYvsaFDNERZMObLpYk5hknTnh8lgq3P8=' 
WHERE 
  key_id = '2ae8c6ec0472b7d4ccd62b325fff4053dd6ae47a4726bb23f57ca67cca22b960' 
  AND (
    token = 'Ph3KCtJDeZtiYvsaFDNERZMObLpYk5hknTnh8lgq3P8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034