UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZxcbF3X4JQ9HXEWc0FjMxRtqNBPwv7xHcabyy5FoEMI='
WHERE
key_id = '7b961d5cd33f12985d28bf0cda15a12545a3ee9ca5e94691417362a2e643451d'
AND (
token = 'ZxcbF3X4JQ9HXEWc0FjMxRtqNBPwv7xHcabyy5FoEMI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)