UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3hvBr6x9o0f8iFW4M+0A9vCde6+NL7MFbER8T9je77g='
WHERE
key_id = '34504fee9859e520c44cf3e84ddd4a0032ba930caa3ab26dc4d628f7d92b2032'
AND (
token = '3hvBr6x9o0f8iFW4M+0A9vCde6+NL7MFbER8T9je77g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)