UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V+EOxp8DgL3d53Vsx4Z1AUqvUbrFNyERJH5HsQv/oe0='
WHERE
key_id = 'f035dfba2039fc795bf86a370aea41b10c32affb2aed4e2a96459e3a10ae9999'
AND (
token = 'V+EOxp8DgL3d53Vsx4Z1AUqvUbrFNyERJH5HsQv/oe0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)