UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KEk6XKHNUUSVzvFUaajh/VS80GBVpidJFOfEIW1exTM='
WHERE
key_id = '99657a2c2ae72d07fa2e18d950cad9346a09fb6135f5c5a60c138da56a8192e1'
AND (
token = 'KEk6XKHNUUSVzvFUaajh/VS80GBVpidJFOfEIW1exTM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)