UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QFFKJjmu+6rUuTXZxJa3IWNby2SGE7Vi0TdMBrx/bDs=' 
WHERE 
  key_id = '1ae63a0450d82bb988b3a1a67e10b7bfa68e384f699099a1b1653c8b3cc239be' 
  AND (
    token = 'QFFKJjmu+6rUuTXZxJa3IWNby2SGE7Vi0TdMBrx/bDs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028