UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5JMkG6E6ML/KNicQdV3v67m1ZM9gNoBMat8gqzu1SdA='
WHERE
key_id = 'b1934cdae1d1eb3b95a88d4d3c49906d33038bf61466ba14689b2fa7b128b646'
AND (
token = '5JMkG6E6ML/KNicQdV3v67m1ZM9gNoBMat8gqzu1SdA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)