UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JuvkR7dqCk3qkNH9kdKqm+atRfTjNCZebo5iakHUWVk='
WHERE
key_id = '0ac0e70357c8c41680e295f32e264c41cdccaf220bd670222784c949c1cdc67d'
AND (
token = 'JuvkR7dqCk3qkNH9kdKqm+atRfTjNCZebo5iakHUWVk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)