UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+gDaU/a8xWBBRcAkQmlx36nkanNiMoiiMQKvZkVFQVQ=' 
WHERE 
  key_id = '95395628d6cca0bdef158fb6c949e37c5cd988c3933a2c26f27aa5cf10910c2d' 
  AND (
    token = '+gDaU/a8xWBBRcAkQmlx36nkanNiMoiiMQKvZkVFQVQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041