UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd0qKUPuMFUUTbNCnvYhTdg7zPO9reSTqdm8/yh4Lf1s=' 
WHERE 
  key_id = '8f9c65c7ab8e285847f852ad8c59d66adad968830e93d000fc93eee2bd414b03' 
  AND (
    token = 'd0qKUPuMFUUTbNCnvYhTdg7zPO9reSTqdm8/yh4Lf1s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038