UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GmKFKDd2EVs+ki5o1QvZ/EHYLvTKe1KkM/zehNk6vf8='
WHERE
key_id = 'f4203c875fb6bd7f9f965015ebb2ca88cbbefac2eaa2d50907dd4a6eabe25cb2'
AND (
token = 'GmKFKDd2EVs+ki5o1QvZ/EHYLvTKe1KkM/zehNk6vf8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)