UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3xxkKJnwPphKXsm3EqCbe9vtPZk88Brip/RIh+oiluQ='
WHERE
key_id = '177d516edc0c0ce543a5e523f94e11264b99112e6daf960bb6190fac6a806bd1'
AND (
token = '3xxkKJnwPphKXsm3EqCbe9vtPZk88Brip/RIh+oiluQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)