UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5KoQO3qovHawgJ8IGHYgMviiCB1fEtDL97h0qte4VhI='
WHERE
key_id = '701ec79d0eebaf1e79e0bd35d71544bdedc0e28c6858bc632ff72c8da0b74764'
AND (
token = '5KoQO3qovHawgJ8IGHYgMviiCB1fEtDL97h0qte4VhI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)