UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OtAzkQCjZniT8LBwdr5HrcP0uTN8uaXJmtCnpxIiXnI='
WHERE
key_id = 'e652372a55f727903d8617e871d3d317bb2577615c326c6a9aa9a4fb901b8609'
AND (
token = 'OtAzkQCjZniT8LBwdr5HrcP0uTN8uaXJmtCnpxIiXnI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)