UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iIGHBCzyTCaklS0E4SciUg2g2xGVjfjbF0VIUFjtYug=' 
WHERE 
  key_id = '37f04b281024f479545c42c61ec593c72627653e6db0696228cc06ffc307eedc' 
  AND (
    token = 'iIGHBCzyTCaklS0E4SciUg2g2xGVjfjbF0VIUFjtYug=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024