UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pJ1xTMnPzI45lWQ1s/0oENg1HjRa5TcRFA/REb/ue8c='
WHERE
key_id = '7ff468a94e78af5d7458a8db4e8061c0afa54bd07655d9a37e88f8bd50e176fc'
AND (
token = 'pJ1xTMnPzI45lWQ1s/0oENg1HjRa5TcRFA/REb/ue8c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)