UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GahgQG1JyzAYlOBjyzExmA5onj0aX18wuus2ZDBE5zc='
WHERE
key_id = '159ffcab00569d196675963cff5e221db6b907513a9e3612ea5b07c471b57788'
AND (
token = 'GahgQG1JyzAYlOBjyzExmA5onj0aX18wuus2ZDBE5zc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)