UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M+y5+yb5TrLVwpaUVYYHlRk7i+8LxK9UKZjO17NED8A='
WHERE
key_id = 'c11eef7306df88b42abbc5849a0882944ec236b5fa51bbd4eac8a3a9e57229a5'
AND (
token = 'M+y5+yb5TrLVwpaUVYYHlRk7i+8LxK9UKZjO17NED8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)