UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eVmq6NhTtaVGdqtxT97yGZiyMbE+u3YYkuxrD4shWr8=' 
WHERE 
  key_id = 'd83575cac6810668137b0b39c2ea25ec63394e6c62eb117a41710ae538469947' 
  AND (
    token = 'eVmq6NhTtaVGdqtxT97yGZiyMbE+u3YYkuxrD4shWr8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020