UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+lVX0YMKpWzKbthsfIX8BwJsSHMKo6rZ2vDaFXeiUps='
WHERE
key_id = '782f3909d631e040bc91e27a347f6e339de8645d9e6b13cb454c69c1392555ff'
AND (
token = '+lVX0YMKpWzKbthsfIX8BwJsSHMKo6rZ2vDaFXeiUps='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)