UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ooIpn/Wvsm1niBoCAI6beVeeNUyeCW6VYD9+Zpvp/nE='
WHERE
key_id = '5b65c195cf4c75e78a43bb8afb3466973f0c066ed78992fcc54eb67f4aaccf90'
AND (
token = 'ooIpn/Wvsm1niBoCAI6beVeeNUyeCW6VYD9+Zpvp/nE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)