UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SInBMpiSpJvgj2vUZK3REQXRQT2dhK23RKMeXh24JbA='
WHERE
key_id = '9424bdc8be9ed030a133d9b93e7fb5ba3ccbe70d74d31e6784ba5bd6e82df8fd'
AND (
token = 'SInBMpiSpJvgj2vUZK3REQXRQT2dhK23RKMeXh24JbA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)