UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z7CdR60RsJ1HduvHQw/UsirJ5DVwb3mvi3RzKE6sCd0='
WHERE
key_id = '4491fa556d5e94ea01ae7a48ed6a3266db690fbab7c470b7281131f1e9c06945'
AND (
token = 'Z7CdR60RsJ1HduvHQw/UsirJ5DVwb3mvi3RzKE6sCd0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)