UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IcFafa7f8WKeK0V3kkiAdtKGsU/+bm7LhZ6m+n5rUmI='
WHERE
key_id = '1ecceb9d3784aa8d8eb555c82367312b4b1616c8d2cc15b95d0818977b13feac'
AND (
token = 'IcFafa7f8WKeK0V3kkiAdtKGsU/+bm7LhZ6m+n5rUmI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)