UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HRHnxXsDMd2mxmSmcDJ/rIMLsucPxOUdLgWK2schG+E='
WHERE
key_id = 'f3362e6e022d5d679c62b5c66056ef0ac9a69a124c8d5da3fdfe745534e33670'
AND (
token = 'HRHnxXsDMd2mxmSmcDJ/rIMLsucPxOUdLgWK2schG+E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)