UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pMaoAjVGoatjLXJWKLjIid+zfTQIBwJceHLbExYI7lU='
WHERE
key_id = '4d4a3e9d4250061cfa29dff4ff4a89e44310eb70dfac9376ef9586c9e8521e25'
AND (
token = 'pMaoAjVGoatjLXJWKLjIid+zfTQIBwJceHLbExYI7lU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)