UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K9b97ogdfhlV8BtcI41prRBkoKEiCR9Nxgpic4DUN3U='
WHERE
key_id = '1c9527868e46bc7f2b77a62537422b3096b611f48ced7433d6285b83413eee73'
AND (
token = 'K9b97ogdfhlV8BtcI41prRBkoKEiCR9Nxgpic4DUN3U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)