UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FkmJL3lJhLax0VPkKQW57MwJ0SJLCFfQLsX0Tf8iEhM=' 
WHERE 
  key_id = '46fe8a86da806c20cb036518407f374ea575da4463761cacfaf0702ff3a18575' 
  AND (
    token = 'FkmJL3lJhLax0VPkKQW57MwJ0SJLCFfQLsX0Tf8iEhM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053