UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OOUT5ubYi6FxSm0auZdV5qldA3b7MvFy3Sm+mJmaO6c='
WHERE
key_id = 'c9302f21955c55130c9e3ad273bca27f81ae46108caef612c7bda13232932ea9'
AND (
token = 'OOUT5ubYi6FxSm0auZdV5qldA3b7MvFy3Sm+mJmaO6c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)