UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tKBkxGBj+npLElDdrxlhkrBHiTSf+qLeKf5xNJuqT08='
WHERE
key_id = 'f40a13be584f2f39c569cef4312f437902c6ee586853dfd030ec37f79df3c290'
AND (
token = 'tKBkxGBj+npLElDdrxlhkrBHiTSf+qLeKf5xNJuqT08='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)