UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Qrf+SDJaZVZ6FVxpsy0OfiIDwiis+W87IGz5u8uAjo='
WHERE
key_id = '2c0c9437015ca1a6c31d7b98388ec76e4b61dda97e4c038d1afa2ee7267f4364'
AND (
token = '2Qrf+SDJaZVZ6FVxpsy0OfiIDwiis+W87IGz5u8uAjo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)