UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pospyhIVVpDvs9/MjE49e/uRT3Xhvq6mlJqokDwf66A='
WHERE
key_id = 'f571812589eaf8e549895d92ccb8ff01ebebdf700869b284bac7319f44eea22f'
AND (
token = 'pospyhIVVpDvs9/MjE49e/uRT3Xhvq6mlJqokDwf66A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)