UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wQK0mfdbykmxJhDI0Uj5ED+3s/UJAGYgajPIi25R5Rc='
WHERE
key_id = '1b53efe93db25515b0532e7d1733cc7142ba4a62b7b94b1f5337e53a4b0dcc86'
AND (
token = 'wQK0mfdbykmxJhDI0Uj5ED+3s/UJAGYgajPIi25R5Rc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)