UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WtGGqB7f/VIbOtrd7suUO7Aky+EpkwoDZXZmIDPpGSU='
WHERE
key_id = '9e1dc1fd8f370073d48a934accda4ef9b7d9fc2988a6adaa47b9e3966463db9e'
AND (
token = 'WtGGqB7f/VIbOtrd7suUO7Aky+EpkwoDZXZmIDPpGSU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)