UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Wj4YjmblW3NnRz2upKEI3yoJ4A+4wfcNn6ayzKRuLc=' 
WHERE 
  key_id = '0291b8847c6f0d8f035c3bae93ac475f1fb95b22bdcfa57b9696df4554e5b64a' 
  AND (
    token = '0Wj4YjmblW3NnRz2upKEI3yoJ4A+4wfcNn6ayzKRuLc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026