UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Kf05X4qgzPZ3OYHDxWWoi7q++fwhD0Kx4hIwDJ/ITsM='
WHERE
key_id = '91df31c689f82820f7f6527883627a00f73e59b08d80e723de6747b0bef085a3'
AND (
token = 'Kf05X4qgzPZ3OYHDxWWoi7q++fwhD0Kx4hIwDJ/ITsM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)